package com.king.pattem.factory.abstractFactory.factory.impl;

import com.king.pattem.factory.abstractFactory.car.ICar;
import com.king.pattem.factory.abstractFactory.factory.IFactory;
import com.king.pattem.factory.abstractFactory.factory.car.ICarFactory;
import com.king.pattem.factory.abstractFactory.factory.car.impl.BmwFactory;
import com.king.pattem.factory.abstractFactory.factory.plane.IPlaneFactory;
import com.king.pattem.factory.abstractFactory.factory.plane.impl.F35Factory;
import com.king.pattem.factory.abstractFactory.plane.IPlane;
/**
 *	产品工厂实现类（依据其他子产品工厂调用，实现创建产品	）
 * @author taomk
 */
public class ProductFactoryByFactory implements IFactory {

	@Override
	public ICar buildCar() {
		
		ICarFactory carFactory = new BmwFactory();
		return carFactory.buildCar();
	
	}

	@Override
	public IPlane buildPlane() {
		
		IPlaneFactory planeFactory = new F35Factory();
		return planeFactory.buildPlane();
		
	}

}
